<%-- 
    Document   : GestionarAtributos
    Created on : 30-jun-2008, 19:40:33
    Author     : Ramon
--%>

<%@ page language="java" import="java.util.*" %>
<%@ page language="java" import="java.sql.*" %>
<%@ page language="java" import="com.akcess.vo.*" %>
<%@ page language="java" import="manejadores.*" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
            String path = request.getContextPath();
            String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head>
        <!--  Version: Multiflex-3.12 / Overview                    --><!--  Date:    January 20, 2008                             --><!--  Design:  www.1234.info                                --><!--  License: Fully open source without restrictions.      --><!--           Please keep footer credits with the words    --><!--           "Design by 1234.info" Thank you!             -->
        <script language="JavaScript">
            <!--
            function aviso(nombre,id){
                if(confirm("¿Esta seguro que desea BORRAR el atributo " + nombre+"?"))
                    parent.location="GestionarTipos_de_Recursos?hacer=opBorrarAtributo&id=" + id + "&nombreAtributo=" + nombre;
            }
            
            -->
            
        </script>    

       
        <base href="<%=basePath%>">
        <link rel="stylesheet" type="text/css" media="screen,projection,print" href="./css/layout4_setup.css">
        <link rel="stylesheet" type="text/css" media="screen,projection,print" href="./css/layout4_text.css">
    <link rel="icon" type="image/x-icon" href="./img/favicon.ico"><title>SRR - Sistema de Reserva de Recursos</title><!-- Global IE fix to avoid layout crash when single word size wider than column width --><!--[if IE]><style type="text/css"> body {word-wrap: break-word;}</style><![endif]--><link href="./css/highlighter.css" type="text/css" rel="stylesheet"><link href="./css/highlighter_002.css" type="text/css" rel="stylesheet"></head><body>
        <!-- Main Page Container -->
        <div class="page-container">
            
            <!-- For alternative headers START PASTE here -->

    <!-- A. HEADER -->      
            <jsp:include page="../Header.jsp"/>
            
            <!-- For alternative headers END PASTE here -->

            <!-- B. MAIN -->
            <div class="main">
                
                <!-- B.1 MAIN NAVIGATION -->
                <jsp:include page="../barraOperaciones.jsp"/> 
                <!-- B.2 MAIN CONTENT -->
                <div class="main-content">
                    
                    <!-- Pagetitle -->
                    <h1 class="pagetitle">Gestionar Atributos</h1>                   
                    <table border="0">
                        <tbody>                           
                            <tr><th class="top"><b>Nombre del Subtipo</b> </th>
                                <th class="top"><b>Descripcion</b> </td>
                            </tr>    
                            <%
            Connection cone;
            cone = (Connection) session.getAttribute("conexion");
            ManejadorAtributos manejador = new ManejadorAtributos(cone);
            Atributos_recursos[] vectorAtributos = manejador.BuscarTodosAtributos();
            for (int i = 0; i < vectorAtributos.length; i++) {
                out.println("<tr>");
                out.println("<td>" + vectorAtributos[i].getNombre() + "</td>");
                String descrip=vectorAtributos[i].getDescripcion();
                if(descrip==null)
                    out.println("<td>" + "No tiene" + "</td>");
                else
                    out.println("<td>" + descrip + "</td>");
                out.println("<th class=\"nada\"><a href=\"javascript:aviso("+"\'"+vectorAtributos[i].getNombre()+"\'"+","+"\'"+ vectorAtributos[i].getId_atributos()+"\'"+");\">Borrar</a></td>");
                out.println("</tr>");
            }

                            %>                              
                            <tr> 
                            <%
                                String error = (String) request.getAttribute("Error");
                                if (error != null) {
                                out.println("<br><p><FONT FACE=\"arial\" SIZE=1 COLOR=red>" + error + "</FONT></p>");
                                }
                            %>
                            </tr>
                            <tr>  </tr>
                            <tr>  
                                <form name="crear" action="GestionarTipos_de_Recursos?hacer=opAgregarAtributo" method="post">
                                    <table border="1">
                                        <tbody>
                                            <tr>
                                                <th>Nombre</th>
                                                <th ><input type="text" name="nombreAtributo" value=""> </th>
                                            </tr>
                                            <tr>
                                                <th>Descripcion</th>
                                                <td><textarea name="descripcion" cols="15" rows="5" ></textarea></td>
                                            </tr>
                                            <tr>
                                                 <th class="nada" colspan="2"><input type="submit" name="btnGuardar" value="Agregar Atributo"></th>
                                            </tr>
                                        </tbody>    
                                    </table>
                                </form>
                                    
                            </tr>
                        </tbody>
                    </table>
                    
                </div>
                
                
                <!-- B.3 SUBCONTENT -->                
            </div>
            <!-- C. FOOTER AREA -->   
            <%@include file="../footer.jsp"%>          
        </div>         
    </body>
</html>